FROM yolobuilder AS builder

COPY ./ /app
WORKDIR /app

RUN pip install -i https://mirrors.aliyun.com/pypi/simple/ cython && \
    python setup.py


FROM yolobuilder
RUN mkdir /app
WORKDIR /app
COPY --from=builder /app/requirements.txt /app/requirements.txt
RUN pip install -i https://mirrors.aliyun.com/pypi/simple/ -r /app/requirements.txt
COPY --from=builder /app/build /app
COPY --from=builder /app/main.py /app/main.py
COPY --from=builder /app/.env.staging /app/.env.staging
CMD ["python", "main.py", "--env", "staging"]
